package com.koalton.steward.flow.model;

/**
 * Created by koalton on 2017/7/11.
 */
public enum ItemKindType {
    ITEM_KIND_衣(1, "衣"),
    ITEM_KIND_食(2, "食"),
    ITEM_KIND_住(3, "住"),
    ITEM_KIND_行(4, "行"),
    ITEM_KIND_用(5, "用");

    private Integer vlaue;
    private String desc;

    ItemKindType(Integer itemTypeValue, String itemTypeDesc) {
        this.vlaue = itemTypeValue;
        this.desc = itemTypeDesc;
    }

    public Integer getVlaue() {
        return this.vlaue;
    }

    public String getDesc(){return this.desc;}

    /**
     * 通过ItemType的值返回枚举类型
     *
     * @param value ItemType的值
     * @return ItemType的实例
     */
    /**
     * 通过ItemKindCode的值返回枚举类型
     * @param value KindCode
     * @return
     */
    public ItemKindType translate2ItemType(Integer value) {
        switch (value.intValue()) {
            case 1:
                return ITEM_KIND_衣;
            case 2:
                return ITEM_KIND_食;
            case 3:
                return ITEM_KIND_住;
            case 4:
                return ITEM_KIND_行;
            case 5:
                return ITEM_KIND_用;
            default:
                return null;
        }
    }
}
